home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / e_to_l / fbuilder / exprlist.txt next >
Text File  |  1996-09-15  |  7KB  |  271 lines

  1. ; FORMULABUILDER Test Expression Set
  2. ; Lines starting with a semicolon are ignored;
  3. ;
  4. " Tan(90)/Cos(90) = " + Str( TAN(90) / COS(90) )
  5. 'A' > 'B'
  6. 'Current Balance '+padright( '$'+Str(weekday(today()) * 10)+'.50', 10,'*')
  7. 'Days this month '+str(choose(month(today()),31,28,31,30,31,30,31,31,30,31,30,31) )
  8. 'The fractional value of Cos(10) = '+Str(Frac(Cos(10)))
  9. 'The square root of 89 is '+str( sqrt(89) )
  10. 'This tests the error-trapping ability of FB '+Str(1/0)
  11. 'Today is '+Choose(weekday(Today()),"Sun","Mon","Tue","Wed","Thu","Fri","Sat")
  12. 1 and 13
  13. 10^2
  14. 13 mod 3
  15. 7 or 8
  16. 17 div 2
  17. ABS( Cos(90) )
  18. ABS(-10)
  19. ACOS(-0.5)
  20. ACOSH(6)
  21. ACOT(.70)
  22. ACOTH(4)
  23. ACSC(0.5)
  24. CSC(0.75)
  25. ACSCH(2)
  26. ASC('z')
  27. ASEC(0)
  28. ASECH(0.5)
  29. ASIN(1)
  30. ASINH(1.5)
  31. ATAN(1.75)
  32. ATANH(0.5)
  33. ATAN2(-1,-1)
  34. AVG(1,2,3,4,5,6,7, MAX(1,2,3,4,5) )
  35. CEILING(10.22)
  36. Char(32) <= '$'
  37. char(74)
  38. CLEAN(char(90)+char(194)+char(178)+' clean string '+char(180))
  39. CODE('m')
  40. COS( PI )
  41. COSH(1.5)
  42. COT(pi)
  43. COTH(1)
  44. CSCH(1)
  45. DATE( month(today()), day(Today()), year(today()) )
  46. DATETOSTR( Today() + 7)
  47. DEGREES(1.75)
  48. EXP( ln(e) )
  49. EXP(-1.25)
  50. EXTRACT(4,'returned should be returned',' ')
  51. FACT(10)
  52. FIND('.',str(cos(45)))
  53. FIRST(8,'The rain in Spain')
  54. HOUR( TimeNow() )
  55. IIF(dayname(today())='Monday','Whered the weekend go',Str(6-Weekday(today()))+' days till friday !')
  56. INT(10.9)
  57. ISEVEN(57)
  58. ISODD(57)
  59. LENGTH('The length of this string is 31')
  60. LOG(100)
  61. LOG(100,10)
  62. LOG(8,2)
  63. LOWER('JUST SO YOU WONT SHOUT AT ME')
  64. LTRIM('******$99.00','*')
  65. MAX( Cos(PI) , SIN(PI) , ATAN(PI) , CSC(PI) , COT(PI) )
  66. MID("Test is what this should return",4)
  67. MID("This should return Test",20,4)
  68. MINUTE( TimeNow() )
  69. NOW()
  70. PADCENTER('Centered String',45,'*')
  71. PRODUCT(1,80,6,5,4,3,2,2)
  72. PROPER('SAMuEL wooDSON')
  73. RADIANS(90)
  74. REPLACE('Please send the IRS your taxes','the IRS','me')
  75. REPLICATE(char(196),30)
  76. RTRIM('I hate trailing spaces         ',' ')
  77. SECH(0)
  78. SGN(-9)
  79. SIN( radians(90) )
  80. SINH(1)
  81. SOUNDALIKE('dead','head')
  82. SOUNDEX('haywood')
  83. SOUNDEX('Wayward')
  84. SQR(10)
  85. SQRT(144)
  86. STR(1024.678)
  87. INSERT(' NOT ','The moon is made of green cheese',12)
  88. MAXSTR('Daniel','Mary','Ian','Alicia','Paul','Barbara','Lushena')
  89. MINSTR('well','trained','horsemen','ride','swiftly')
  90. SUM(1,10,19,25,36,18)
  91. TAN(PI)
  92. TANH(1)
  93. TIME(10,10,10)
  94. TODAY() + 10
  95. TODAY() > {10/10/95}
  96. TRIM('  both leading and trailing strings trimmed  ')
  97. TRUE & FALSE
  98. TRUE | FALSE
  99. UPPER('just so you dont feel so down..')
  100. VAL("100.678")
  101. WORDCOUNT('This function, if successful, should return 7',' ,')
  102. DATEDIFF(today(), {10/10/2001})
  103. DATEVALUE("10/10/96")
  104. DAY( Today() )
  105. DAYNAME( today() )
  106. DB(10000,1200,8,5)
  107. DEGREES( 10.0245  )
  108. FLOOR(25.43)
  109. INT(499.99)
  110. LN( e )
  111. MIN(10, 6, month(today()), cos(pi) )
  112. MONTH( Today() )
  113. MONTHNAME( Today() + 45 )
  114. PADLEFT("I hate right justification",40,"*")
  115. "Check Amount "+PADRIGHT("$"+Str(10000,2),10,"*")
  116. RAND()
  117. RAND(5)
  118. RAND(1,10)
  119. LAST(6,"Reading is fundamental")
  120. ROUND(134.578)
  121. SEC(1.23)
  122. SECOND( timenow() )
  123. SGN( cos(pi) )
  124. TERM(300,.06,5000)
  125. TIME(10,10,35)
  126. TIMENOW()
  127. TIMETOSTR( Today() + 365 )
  128. TIMEVALUE("12:54 am")
  129. TODAY()
  130. VAL("365" + ".456")
  131. WEEKDAY(Today() + 5)
  132. YEAR( Today() )
  133. ; Thanks to JW Rider for the financial routines
  134. ; FORMULABUILDER Financial Functions are, for the most part,
  135. ; compatible with those of Quattro Pro 3.0
  136. ; The examples are derived from the Quattro Pro 3.0 @Functions
  137. ; and Macros manual
  138. ;
  139. ; page 29 (CTERM)
  140. ;
  141.   str(cterm(0.07,5000,3000) , 2)
  142.   str(nper(0.07,0,-3000,5000,0), 2) + '(nper)'
  143.   str(cterm(0.1,5000,3000), 6)
  144.   str(cterm(0.12,5000,3000), 6)
  145.   str(cterm(0.12,10000,7000), 6)
  146. ;
  147. ; pages 35-36 (DDB):
  148. ;
  149.   ddb(4000,350,8,2)
  150.   ddb(15000,3000,10,1)
  151.   ddb(15000,3000,10,2)
  152.   ddb(15000,3000,10,3)
  153.   ddb(15000,3000,10,4)
  154.   ddb(15000,3000,10,5)
  155. ;
  156. ; 'page 48 (FV):
  157. ;
  158.   str(fv(500,0.15,6),2)
  159.   str(fval(0.15,6,-500,0,0),2)
  160.   str(fv(200,0.12,5),2)
  161.   str(fv(500,0.9,4),2)
  162.   str(fv(800,0.9,3),2)
  163.   str(fv(800,0.9,6),2)
  164. ;
  165. ; 'page 49 (FVAL):'
  166.   str(fval(0.15,6,-500,0,1),2)
  167.   str(fval(0.15,6,-500,-340,1),2)
  168. ;
  169. ;  page 57 (IPAYMT):
  170. ;
  171.    str( ipaymt(0.1/12,2*12,30*12,100000,0,0),2 )
  172. ;
  173. ; pages 57-58 (IRATE):
  174. ;
  175.   str( irate(5*12,-500,15000,0,0),5)
  176.   str( irate(5,-2000,-2.38,15000,0) , 4)
  177. ;
  178. ;  pages 60-61 (IRR):
  179. ;
  180.   str( irr(0,-10,150,-145)*100 , 2) +'%'
  181.   str( irr(10,-10,150,-145)*100, 0) +'%'
  182.   str( irr(0,-10,150.1,-145)*100 , 2) +'%'
  183.   str( irr(10,-10,150.1,-145)*100, 0 ) + '%'
  184.   str( irr(0,-3000,700,600,750,900,1000,1400)*100 , 2) +'%'
  185.   str( irr(0,-50000,-8000,2000,4000,6000,5000,4500)*100 , 2) +'%'
  186.   str( irr(0,-10000,1000,1000,1200,2000,3000,4000)*100 , 2) +'%'
  187. ;
  188. ; page 73 (NPER):
  189. ;
  190.   str( nper(0.115,-2000,-633,50000,0),2 )
  191. ;
  192. ; page 75 (NPV):
  193. ;
  194.   str( npv(0.1,-5000,2000,2000,2000,2000, 0) )
  195.   str( -5000 + npv(0.1,2000,2000,2000,2000,0), 2 )
  196.   str( npv(0.0125, 8000,9000,8500,9500,10000,11000,10000) ,2 )
  197.   npv(0.15/12, 200,350,-300,600,700,1000,1200)
  198.   npv(0.15/12,3500,4000,3000,5000,4000,6500,7000)
  199. ;
  200. ; page 77 (PAYMT):
  201. ;
  202.   str(paymt(0.175/12,12*30,175000,0,0),2)
  203.   str(paymt(0.175/12,12*30,175000,0,1),2)
  204.   str(paymt(0.175/12,12*30,175000,-80000,0),2)
  205. ;
  206. ;  pages 78-79 (PMT)
  207. ;
  208.   str(PMT(10000,0.15/12,3*12),2)
  209.   str( PAYMT(0.15/12,3*12,10000,0,0), 2) + '(paymt)'
  210.   str(pmt(1000,0.12,5) ,2 )
  211.   str(pmt(500,0.16,12), 2)
  212.   str(pmt(5000,0.16/12,12) ,2)
  213.   str(pmt(12000,0.11,15) ,2 )
  214. ;
  215. ; page 79 (PPAYMT):
  216. ;
  217.   str(ppaymt(0.1/12,2*12,30*12,100000,0,0), 2)
  218.   str(ppaymt(0.15/4,24,40,10000,0,1), 2)
  219. ;
  220. ; page 81 (PV)
  221. ;
  222.   str(pv(350,0.07/12,5*12),2)
  223.   str(pval(0.07/12,5*12,-350,0,0), 2)
  224.   str(pv(277,0.12,5),2)
  225.   str(pv(600,0.17,10),2)
  226.   str(pv(100,0.11,12),2)
  227. ;
  228. ; page 82 (PVAL)
  229. ;
  230.   str(pval(0.1,12,2000,0,0),2)
  231.   str(pval(0.1,15,0,30000,0),2)
  232. ;
  233. ; page 84 (RATE)
  234. ;
  235.   str( rate(4000,2000,10)*100, 2) + '%'
  236.   str( rate(10000,7000,6*12)*100, 2) + '%'
  237.   str( rate(1200,1000,3)*100, 2) + '%'
  238.   str( rate(500,100,25)*100, 2) + '%'
  239. ;
  240. ; page 89 (SLN)
  241. ;
  242.   str(sln(4000,350,8),2)
  243.   str(sln(15000,3000,10), 0)
  244.   sln(5000,500,5)
  245.   sln(1800,0,3)
  246. ;
  247. ; pages 94-95 (SYD)
  248. ;
  249.   str( syd(4000,350,8,2),2)
  250.   syd(12000,1000,5,1)
  251.   syd(12000,1000,5,2)
  252.   syd(12000,1000,5,3)
  253.   syd(12000,1000,5,4)
  254.   syd(12000,1000,5,5)
  255. ;
  256.   ddb(12000,1000,5,1)
  257.   ddb(12000,1000,5,2)
  258.   ddb(12000,1000,5,3)
  259.   ddb(12000,1000,5,4)
  260.   ddb(12000,1000,5,5)
  261. ;
  262. ; page 96 (TERM)
  263. ;
  264.   str( term(2000,0.11,50000),2)
  265.   str( nper(0.11,-2000,0,50000,0) , 2)
  266.   str( term(300,0.06,5000) , 1)
  267.   str( term(500,0.07,1000) , 2)
  268.   str( term(500,0.07,1000) , 2)
  269.   str( term(1000,0.10,50000) , 1)
  270.   str( term(100,0.05,1000) ,1)
  271.